--[[
飺
    ˽űǰѵӢͷ޸ĵϣĬΪո񣬿޸
޸λüűġ

ʹ˵
  нű֮޸ĵļɵӢͷЧ

ע
ٴ˽űżλôҪ
ڻӭ飬qq:167849866 bbs.myebe.com

                                      ߣǡ
                                                    ]]

--űģ

if getwshscriptversion() < 2 then
    msgbox('ʹ2.4汾')
end

--û޸Ĵ
selfkey=32 --ոļ룬޸ģWΪ87
--û޸Ĵ

currentx=0
currenty=0
setkeywatch('keyhookfunc')

function keyhookfunc(keycode, controlkey, downorup)
          currentx,currenty = getcursorpos()
    if 0==iswar3front() then return 0 end
    if 1==ischat() then return 0 end
    if downorup==1 then return 0 end
    if keycode==selfkey and downorup==0 then
--        currentx,currenty = getcursorpos()
        sleep(10)
        war3w = getwar3window()
        war3wl,war3wr,war3wt,war3wb = getwindowrect(war3w)
        herox=war3wl+(war3wr-war3wl)*0.3125
        heroy=war3wt+(war3wb-war3wt)*0.9
        setcursorpos(herox, heroy)
        sleep(20)
        mousedown(0)
        mouseup(0)
        sleep(10)
        setcursorpos(currentx, currenty)
    return 1
    end
end
